-
Notifications
You must be signed in to change notification settings - Fork 721
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor Aqara Roller Driver E1 as v2 quirk to expose configuration and status entities #3686
base: dev
Are you sure you want to change the base?
Conversation
- Refactor into v2 quirk - Refactor clusters to use AttributeDefs format - Represent the device as a Rollershade rather than Drapery - Refresh current position after a stop command is issued - Expose attributes as entities: - Motor speed (select) - Charging status (binary sensor) - Calibration status (binary sensor)
- Update existing tests to use the v2 quirk - Add test for the charging status attribute value handling
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #3686 +/- ##
==========================================
+ Coverage 89.85% 89.87% +0.01%
==========================================
Files 322 322
Lines 10380 10400 +20
==========================================
+ Hits 9327 9347 +20
Misses 1053 1053 ☔ View full report in Codecov by Sentry. |
Have identified an issue with the cover state not reliably changing to open/closed. Investigating this currently. |
@TheJulianJES, @dmulcahey looking at the code in https://github.com/zigpy/zha/blob/dev/zha/application/platforms/cover/__init__.py I've tested the following scenarios: 1. go_to_lift_percentage has never been called, down_close is called, then the device reports position_or_tilt of 0 2. go_to_lift_percentage has never been called, up_open is called, then the device reports position_or_tilt of 100 3. go_to_lift_percentage is called (go to 0), then the device reports position_or_tilt of 0 4. go_to_lift_percentage is called (go to 100), then the device reports position_or_tilt of 100 5. go_to_lift_percentage is called (go to 50), then the device reports position_or_tilt of 50 6. go_to_lift_percentage has previously been called (stored value is 50), down_close is called, then the device reports position_or_tilt of 0 7. go_to_lift_percentage has previously been called (stored value is 50), up_open is called, then the device reports position_or_tilt of 100 8. go_to_lift_percentage has previously been called (stored value is 50) and current position is 100, stop is called I'd suggest we can handle this in one of 3 ways:
Below is the current function for reference:
|
Proposed change
This PR refactors the existing Aqara Roller Driver E1 quirk into the new v2 structure to expose the configuration and status attributes, below is a summary of changes:
Functional enhancements
Additional information
Whilst I've validated that is works with my own E1 roller shade devices, I'd like to ensure other users do not encounter any regressions with this refactor.
@dmulcahey / @schwickster / @javicalle / @badrpc / @TheJulianJES I can see in the past you've previously contributed for this device, if you still use it would you mind checking if this updated quirk works as expected without introducing regressions?
Checklist
pre-commit
checks pass / the code has been formatted using Black